package com.xxx.ware.ware_manage_sys.bean.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class WebResultDto<T> {
    @JsonProperty("page_no")
    private Integer pageNo;

    @JsonProperty("page_size")
    private Integer pageSize;

    @JsonProperty("total")
    private Long total;

    @JsonProperty("data_list")
    private List<T> dataList;

    public static <T> WebResultDto<T> getDataList(Integer pageNo, Integer pageSize, Long total, List<T> dataList){
        return new WebResultDto<>(pageNo, pageSize, total, dataList);
    }
}
